/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simplemetrosystem.model.charlanguage;

import java.util.HashMap;

/**
 *
 * @author Eric Qian
 */
public class Language {

    /**
     * 
     * @param index 
     */
    public Language(String index) {
        this.index = index;
        map = new HashMap<String, String>();
        map.put(NameMap.ENGLISH, index);
    }

    /**
     * 
     * @return
     */
    public String getIndex() {
        return index;
    }

    /**
     * 
     * @param name
     * @param language 
     */
    public void addName(String name, String language) {
        map.put(language, name);
    }

    /**
     * 
     * @param language
     * @return
     */
    public String getName(String language) {
        if (map.containsKey(language)) {
            return map.get(language);
        } else {
            System.out.println("Language Error: Language " + language + " index" + index);
            return index;
        }
    }
    private String index;
    private HashMap<String, String> map;
}
